<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>帮助中心</title>
    <script src="/js/vue.js"></script>
    <!-- element-ui引入样式 展示数据的-->
    <link rel="stylesheet" href="/css/index.css">
    <!-- element-ui引入组件库 -->
    <script src="/js/index.js"></script>
    <!--引入axios库  从后端获取数据-->
    <!-- <script src="https://unpkg.com/axios/dist/axios.min.js"></script>-->
    <script src="/js/axios.min.js"></script>
    <style >
        a:hover{
            color:red;
            text-decoration: underline;
        }
    </style>

</head>
<body>
<div id="a">
    <img src="../../imgs/help.png" alt="" style="width: 100%">
</div>
<div id="app">
    <el-table
            :data="tableData"
            style="width: 100%">
        <el-table-column type="expand">
            <template slot-scope="props">
                <el-form label-position="left" inline class="demo-table-expand">
                    <el-form-item label="帮助">
                        <span>{{ props.row.phelp }}</span>
                    </el-form-item>
                </el-form>
            </template>
        </el-table-column>
        <el-table-column
                prop="name">
        </el-table-column>

    </el-table>

</div>
<style>
    .demo-table-expand {
        font-size: 0;
    }
    .demo-table-expand label {
        width: 90px;
        color: #99a9bf;
    }
    .demo-table-expand .el-form-item {
        margin-right: 0;
        margin-bottom: 0;
        width: 50%;
    }
</style>

<script>
    new Vue ({
        el:"#app",
        data() {
            return {
                tableData: [],
                currentPage: 1,
                pageSize: 100
            }
        },
        created: function () {//页面初始化时,需要执行的业务可以放入该方法

            this.loadData();
        },
        methods:{
            loadData() {
                let _this = this;
                //使用axios向后台发请求
                axios.post('/help/queryPage',
                    {
                        "pageNo": this.currentPage, "pageSize": this.pageSize,
                    })
                    .then(function (response) {
                        if (response.data.code == 200) {
                            _this.tableData = response.data.data.list;
                            _this.total = response.data.data.total;
                        }
                    })
                    .catch(function (error) {
                        console.log(error);
                    });
            }
        }
    })

</script>

</body>
</html>